package net.maku.module.chamber.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import net.maku.framework.common.utils.PageResult;
import net.maku.framework.common.utils.Result;
import net.maku.module.chamber.convert.ChamberLogStaffConvert;
import net.maku.module.chamber.entity.ChamberLogStaffEntity;
import net.maku.module.chamber.service.ChamberLogStaffService;
import net.maku.module.chamber.vo.ChamberLogStaffVO;
import net.maku.newbase.NewBaseController;
import net.maku.newbase.NewQuery;
import net.maku.newbase.PageParam;
import org.springframework.web.bind.annotation.*;

/**
* 业务_会议室预定纪录_参与人员
*
* @author    
*/
@RestController
@RequestMapping("nb/chamber_log_staff")
@Tag(name="业务_会议室预定纪录_参与人员")
@AllArgsConstructor
public class ChamberLogStaffController extends NewBaseController<ChamberLogStaffService, ChamberLogStaffEntity> {

    @GetMapping("page")
    @Operation(summary = "分页")
    public Result<PageResult<ChamberLogStaffVO>> page(PageParam page, NewQuery query) {
        LambdaQueryWrapper<ChamberLogStaffEntity> select = new LambdaQueryWrapper<>();

        IPage<ChamberLogStaffEntity> iPage = entityService.page(page.b(), select);
        return Result.ok(new PageResult<>(ChamberLogStaffConvert.INSTANCE.convertList(iPage.getRecords()), iPage.getTotal()));
    }

}